package modele;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;

public class TacheRacine extends TacheComplexe{
	
	private Map<Integer,Tache> listeTotaliteTaches;
	private static TacheRacine instance;
	
	public TacheRacine(int priorite, SimpleDateFormat debut, SimpleDateFormat fin, String descriptif) {
		super(priorite, debut, fin, descriptif);
		this.listeTotaliteTaches = new HashMap <Integer,Tache>();
	}

	public void ajouterTache(Tache tache){
		this.listeTotaliteTaches.put(tache.getId(), tache);
	}
	
	public Map<Integer, Tache> getListeTotaliteTaches() {
		return listeTotaliteTaches;
	}

	public void setListeTotaliteTaches(Map<Integer, Tache> listeTotaliteTaches) {
		this.listeTotaliteTaches = listeTotaliteTaches;
	}
	
	public static synchronized  TacheRacine getInstance(int priorite, SimpleDateFormat debut, SimpleDateFormat fin, String descriptif){
		if(instance==null){
			instance= new TacheRacine(priorite,debut,fin,descriptif);
		}
		
		 return instance ;
		}
		
	}

